package com.easygo.controller;

import com.easygo.service.ILoginLogService;
import com.xuexi.easygo.pojo.LoginLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Scope("prototype")
public class LoginLogController {
    @Autowired
    ILoginLogService logService;

    @RequestMapping("loginLog_add")
    public int addLoginLog(@RequestBody LoginLog log){
        System.out.println("新增的日志对象："+log);
        return logService.addLoginLog(log);
    }

    @RequestMapping("loginLog_logs")
    public List<LoginLog> getMyLoginLogs(@RequestParam String username){
        return logService.getMyLoginLogs(username);
    }
}
